﻿using System;

using MonoTorrent.Client;

namespace SBPweb.RouTorrent.Business
{

    public class PieceStateChangedEventArgs : EventArgs
    {

        #region Private fields

        private TorrentManager mTorrentInfo;
        private int mPieceIndex;
        private bool mHashPassed;

        #endregion

        #region Constructor logic

        public PieceStateChangedEventArgs(TorrentManager manager, PieceHashedEventArgs e)
            : this(manager, e.PieceIndex, e.HashPassed)
        {
        }

        public PieceStateChangedEventArgs(TorrentManager manager, int pieceIndex, bool hashPassed)
        {
            mTorrentInfo = manager;
            mPieceIndex = pieceIndex;
            mHashPassed = hashPassed;
        }

        #endregion

        #region Public properties

        public TorrentManager DownloadManager
        {
            get
            {
                return mTorrentInfo;
            }
        }

        public int PieceIndex
        {
            get
            {
                return mPieceIndex;
            }
        }

        public bool HashPassed
        {
            get
            {
                return mHashPassed;
            }
        }

        #endregion

    }

    public delegate void PieceStateChangedHandler(object sender, PieceStateChangedEventArgs e);

}